import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/reset.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import JsonExcel from 'vue-json-excel'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
Vue.component('downloadExcel', JsonExcel)
Vue.use(VueQuillEditor)
Vue.config.productionTip = false

Vue.use(ElementUI)

new Vue({
  router,
  store,
  created () {
    // 网页刷新时 去缓存 解决 vuex 某个状态 数据丢失问题
    const role = localStorage.getItem('role')
    // 判断role是否存在
    if (role) {
      store.commit('auth/FILTER_MENU', role)
    }
  },
  render: h => h(App)
}).$mount('#app')
